package com.superm.service.impl;

import com.superm.entity.ShelfDetails;
import com.superm.entity.ShelfDetailsPoJo;
import com.superm.mappers.ShelfDetailsMapper;
import com.superm.service.ShelfDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 上架申请单详情
 */
@Service
public class ShelfDetailsServiceImpl implements ShelfDetailsService {

    @Autowired
    private ShelfDetailsMapper shelfDetailsMapper;

    /**
     * 实现模糊查询定单详情
     * @param
     * @return
     */
    @Override
    public Map<String,Object> likeShelfService(String shelfAppCode,Integer pageNo,Integer pageSize){
         Map<String,Object> map = new HashMap<String,Object>();
         map.put("code",0);
         map.put("msg",0);
         if (pageNo!=null && pageSize !=null){
             map.put("data",shelfDetailsMapper.selectCodeDetails(shelfAppCode,(pageNo-1)*pageSize,pageSize));

         }else{
             map.put("data",shelfDetailsMapper.selectCodeDetails(shelfAppCode,null,null));
         }

         //查询条数
        map.put("count",shelfDetailsMapper.selectCount(shelfAppCode));
        return map;
    }
}
